//
//  OverflowView.h
//  PagedFlowView
//
//  Created by 于 百和 on 13-4-17.
//  Copyright (c) 2013年 Taobao.com. All rights reserved.
//

#import <UIKit/UIKit.h>


//#define ImageViewWidth          113
//#define ImageViewHeight         104
//#define ImageViewSpaceLeft      249
//#define ImageViewSpaceTop       229
#define ImageViewWidth          163
#define ImageViewHeight         154
#define ImageViewSpaceLeft      299
#define ImageViewSpaceTop       279
#define ImageOffsetY            0

@class OverflowView;

@protocol  FlowViewDelegate <NSObject>

-(void)CurrentIndexHasChange:(NSNumber *)num;

@end


@protocol FlowViewDataSource <NSObject>

- (CGSize)sizeForPageInFlowView:(OverflowView *)flowView;
//返回显示View的个数
- (NSInteger)numberOfPagesInFlowView:(OverflowView *)flowView;

//返回给某列使用的View
- (UIView *)flowView:(OverflowView *)flowView cellForPageAtIndex:(NSInteger)index;

@end


@interface OverflowView : UIView<UIScrollViewDelegate>
{
    UIScrollView *_ScrollView;
    CGFloat      miniScale;
    CGSize       _pageSize;
    
    NSInteger           _pageCount;  //总页数
    NSInteger           _currentPageIndex;
    CGPoint      lastPoint;
    id <FlowViewDataSource> dataSource;
    id <FlowViewDelegate>   delegate;
    @public
    int          centerIndex;
    
}
@property(nonatomic,assign)   CGFloat miniScale;
@property(nonatomic,assign)   int centerIndex;
@property(nonatomic,retain)   id <FlowViewDataSource> dataSource;
@property(nonatomic,retain)   id <FlowViewDelegate>   delegate;

//-(void)loadPic;
-(void)toNextPage;
-(void)toNextPage:(int) i;
-(void)toPreviousPage;
-(void)toPreviousPage:(int) i;

-(int)GetPageDistance:(CGPoint)point;

@end

